#pragma once

#include "WolvGen.h"
#include "Unit.h"
#include <string>

MAKE_PTR(CVariable);

class CVariable : public CUnit
{
public:
	static CVariablePtr create(std::string strName, EvalType value = 0)
	{
		return CVariablePtr(new CVariable(strName, value));	
	}

public:
	CVariable(std::string strName, EvalType value = 0)
		:m_strName(strName)
	{

	}

	void setValue(EvalType value)
	{
		m_declaredScope->registerSymbol(m_strName, value);
	}
	

protected:

	std::string m_strName;

	EvalType doEval()
	{
		return m_declaredScope->getSymbol(m_strName);
	};

};